/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package reportcenter.report.dominio.footer;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import reportcenter.report.dominio.column.ReportColum;

/**
 *
 * @author renan
 */
@Entity
@Table(name = "COLUM_FOOTER")
@NamedQueries({@NamedQuery(name = "ColumFooter.findByIdCf", query = "SELECT c FROM ColumFooter c WHERE c.idCf = :idCf"), @NamedQuery(name = "ColumFooter.findByColumnName", query = "SELECT c FROM ColumFooter c WHERE c.columnName = :columnName"), @NamedQuery(name = "ColumFooter.findByColumnDescr", query = "SELECT c FROM ColumFooter c WHERE c.columnDescr = :columnDescr"), @NamedQuery(name = "ColumFooter.findByClazz", query = "SELECT c FROM ColumFooter c WHERE c.clazz = :clazz"), @NamedQuery(name = "ColumFooter.findByWidth", query = "SELECT c FROM ColumFooter c WHERE c.width = :width")})
public class ColumFooter implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "ID_CF", nullable = false)
    private Integer idCf;
    @Column(name = "COLUMN_NAME", nullable = false)
    private String columnName;
    @Column(name = "COLUMN_DESCR", nullable = false)
    private String columnDescr;
    @Column(name = "CLAZZ", nullable = false)
    private String clazz;
    @Column(name = "WIDTH", nullable = false)
    private int width;
    
    
    @JoinColumn(name = "ID_RC", referencedColumnName = "ID_RC")
    @ManyToOne
    private ReportColum idRc;

    public ColumFooter() {
    }

    public ColumFooter(Integer idCf) {
        this.idCf = idCf;
    }

    public ColumFooter(Integer idCf, String columnName, String columnDescr, String clazz, int width) {
        this.idCf = idCf;
        this.columnName = columnName;
        this.columnDescr = columnDescr;
        this.clazz = clazz;
        this.width = width;
    }

    public Integer getIdCf() {
        return idCf;
    }

    public void setIdCf(Integer idCf) {
        this.idCf = idCf;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getColumnDescr() {
        return columnDescr;
    }

    public void setColumnDescr(String columnDescr) {
        this.columnDescr = columnDescr;
    }

    public String getClazz() {
        return clazz;
    }

    public void setClazz(String clazz) {
        this.clazz = clazz;
    }

    public int getWidth() {
        return width;
    }

    public ReportColum getIdRc() {
        return idRc;
    }

    public void setIdRc(ReportColum idRc) {
        this.idRc = idRc;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCf != null ? idCf.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ColumFooter)) {
            return false;
        }
        ColumFooter other = (ColumFooter) object;
        if ((this.idCf == null && other.idCf != null) || (this.idCf != null && !this.idCf.equals(other.idCf))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "reportcenter.report.dominio.footer.ColumFooter[idCf=" + idCf + "]";
    }

}
